package com.hhss.qishi.DPtest.designpattern.template;

/**
 * @Auther: zcc
 * @Date: 19-10-9 14:53
 * @Description: 冲饮品
 */
public abstract class FlushingBeverage {

    /**
     * 配剂
     */
    public void prepareRecipe(){
        boilingWater();
        brewing();
        cupping();
        if(isRequired()){
            withTrimmings();
        }

    }

    /**
     * 烧开水
     */
    void boilingWater(){
        System.out.println("boiling the water.");
    }

    /**
     * 冲泡
     */
    abstract void brewing();

    /**
     * 装杯
     */
    void cupping(){
        System.out.println("cupping the beverage.");
    }

    /**
     * 加装饰
     */
    abstract void withTrimmings();

    /**
     * 是否要求
     * @return
     */
    public boolean isRequired(){
        return true;
    }

}
